#ifndef SCHEDULEMODEL_H
#define SCHEDULEMODEL_H

#include <QAbstractTableModel>
#include "userscheduledata.h"
#include "appconfig.h"

class ScheduleModel : public QAbstractTableModel {
Q_OBJECT
public:
    ScheduleModel();
    virtual ~ScheduleModel();

    virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
    virtual int columnCount(const QModelIndex &parent = QModelIndex()) const;
    virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
    virtual QVariant headerData(int section, Qt::Orientation orientation,
                                int role = Qt::DisplayRole) const;
    virtual Qt::ItemFlags flags(const QModelIndex & index) const;

public slots:
    void addUser(const QString& name);
    void switchShiftType(const QModelIndex &index);
    void loadSchedule(const QDate& date);

protected:
    QMap<QString, Schedule*> schedules_;
    Schedule* currentSchedule_;
};

#endif // SCHEDULEMODEL_H
